/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ejercicio.practica3;

import static java.lang.Math.pow;
import static java.lang.Math.sqrt;

/**
 *
 * @author manolo
 */
public class Hiperbola  {
    
    double x,y,a,b,c, xc,xy;

    public Hiperbola(double x, double y, double xc, double yc) {
        this.x = x;
        this.y = y;
        this.xc = xc;
        this.xy = yc;
        this.a = x-xc;
        this.c = y-yc;
        this.b = sqrt(pow(c,2)-pow(a,2));
    }
    
    public boolean pertenece(Hiperbola h)
    {
        boolean resultado = false;
        
        if((pow(h.x,2)/pow(h.a,2))-(pow(h.y,2)/pow(h.b,2)) == 1)
            resultado = true;
        
        return resultado;
    }

     
}
